package com.yunji.cabinet.context.validate;

import com.yunji.common.constant.HTTPStatus;
import com.yunji.common.exception.ServiceException;

public class CabinetValidate {

    public static void checkStaffAuth(Long staffSiteId,Long cabinetSiteId){
        if (!staffSiteId.equals(cabinetSiteId)) {
            throw new ServiceException(HTTPStatus.FORBIDDEN, "您没有权限打开此柜子");
        }
    }

    public static void checkCabinetBind(Long agentId){
        ServiceException.throwException(agentId == null, HTTPStatus.PAYMENT_REQUIRED, "当前货柜未绑定");
    }

}
